import { createApp } from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import * as ElementPlusIconsVue from '@element-plus/icons-vue'



const app = createApp(App)
app.use(store)
app.use(router)
app.use(ElementPlus)

app.mount('#app')
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component)
  }




  import instance from 'axios'

  // 请求拦截器
instance.interceptors.request.use(function (config) {
  let token = localStorage.getItem('token')

  if (token) { // 更新token时不携带token(2小时)
    config.headers.token = token;
  }
  return config
  },
  function (err) {
    return Promise.reject(err)
  })




